package controller.vo

import entity.User

class UserVo {
    var id = -1
    var userName: String = ""
    var userNumber: String = ""
    var phoneNumber: String = ""
    var age = -1
    var gender: String = ""
    var avatar = ""
//    var password: String = ""
    var permission: List<Int>? = null

    fun setInfo(user: User) {
        this.id = user.id
        this.userName = user.userName
        this.userNumber = user.userNumber
        this.phoneNumber = user.phoneNumber
        this.age = user.age
        this.gender = user.gender
        this.avatar = user.avatar
        this.permission = user.myUdr?.map {
            it.role?.id ?: 0
        }.orEmpty()
    }
}